package com.kuaimacode.kframework.api.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kuaimacode.kframework.mybatis.mapper.master.UserMasterMapper;
import com.kuaimacode.kframework.mybatis.models.master.MasterWaitResp;
import com.kuaimacode.kframework.mybatis.models.master.UserMaster;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * @author Administrator
 * @date 2019/04/06
 */
@Service
public class MasterService extends ServiceImpl<UserMasterMapper, UserMaster> {



	public List<MasterWaitResp> findWaitMaster(Long userId, String agentId, Long id, String masterName, String authStatus, String serviceType, String status, String masterStatus){
		List<MasterWaitResp> datas = baseMapper.findWaitMaster(userId,agentId,id,masterName,authStatus,serviceType,status,masterStatus);
		return datas;
	}


	/**
	 * 根据userId查找数据
	 * @return
	 */
	public UserMaster findByUserId(Long userId) {
		QueryWrapper<UserMaster> queryWrapper = new QueryWrapper<>();
		queryWrapper.eq("user_id",userId);//有效
		UserMaster data = baseMapper.selectOne(queryWrapper);
		return data;
	}
}

